// const express = require("express")
// const axios = require("axios")

// axios.get("https://i.maoyan.com/api/mmdb/movie/v3/list/hot.json?ct=%E5%8C%97%E4%BA%AC&ci=1&channelId=4",{
//    params:{
//     ct:"北京",
//     ci:1,
//     channelId:4
//    } 
// }).then(value=>{
//     console.log(value.data);
// })


// 创建服务
const express = require("express");
console.log(express);
const axios = require("axios");
const app = express();

// app.use(express.static(__dirname));

app.get("/maoyan",async (req,res)=>{
    res.set("Access-Control-Allow-Origin","*")
    const {data} = await axios.get("https://i.maoyan.com/api/mmdb/movie/v3/list/hot.json",{
        params:{
            ct:"北京",
            ci:1,
            channelId:4
           }
    });
    res.json(data)

    




})

app.listen(8089,()=>{
    console.log("success-->8089");
})